package com.yellowpage.bigdata.action;
  
import java.io.IOException;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.yellowpage.white.common.Configuration;
import com.yellowpage.white.common.Constants;
import com.yellowpage.white.struts.BaseAction;
import com.yellowpage.white.struts.Module;
import com.yellowpage.white.struts.OperationType;
import com.yellowpage.white.util.Util4Java;

import com.yellowpage.bigdata.data.WeekGonet;
import com.yellowpage.bigdata.service.WeekGonetService;

public class WeekGonetAction extends BaseAction {

    public String RESULT_QUERY = "query";
    public String RESULT_ADD = "add";
	public String RESULT_EDIT = "edit";
	
	private Configuration configuration;
	
	public void setConfiguration(Configuration configuration) {
		this.configuration = configuration;
	}
	
	private List<WeekGonet> weekGonetList = new ArrayList<WeekGonet>();
	private List<Map> resultList = new ArrayList<Map>();
	
	private WeekGonet weekGonet;
	private WeekGonetService weekGonetService;
	
	private String selectedId;	
	private String[] selectedIds;	
	private String message;
	
	

		private String query_offset;
		private String query_dayId;
		private String query_dayId_end;
		private String query_etlTime;
		private String query_cnts;
		private String query_weekGoneId;
		
	public void prepare() {
		super.prepare();
	
		if (this.selectedId != null && !this.selectedId.equals("")) {
			this.weekGonet = weekGonetService.getWeekGonet(Long.parseLong(selectedId));
		}
	}
	
	public String queryByPage() {		
		initPageRender();
		
		Map queryMap = new HashMap();	
			    //queryMap.put("offset", query_offset);
	    	    queryMap.put("dayId", query_dayId);
	    	    queryMap.put("dayId_end", query_dayId_end);
	    	    //queryMap.put("etlTime", query_etlTime);
	    	    //queryMap.put("cnts", query_cnts);
	    	   // queryMap.put("weekGoneId", query_weekGoneId);
	    	    	
		resultList = weekGonetService.queryWeekGonetByPage(queryMap, pageRender);
		
		setPageRenderToRequest();

		return RESULT_QUERY;
	}
	
	
	

	/**
	 * getters and setters
	 * 
	 * @return
	 */
	 public void setWeekGonet(WeekGonet weekGonet) {
		this.weekGonet = weekGonet;
	}
	
	public WeekGonet getWeekGonet() {
		return weekGonet;
	}
	 
	 
	 public void setWeekGonetService(WeekGonetService weekGonetService) {
		this.weekGonetService = weekGonetService;
	}
	
	public List<WeekGonet> getWeekGonetList() {
		return weekGonetList;
	}

	public void setWeekGonetList(List<WeekGonet> weekGonetList) {
		this.weekGonetList = weekGonetList;
	}
	
	public String getSelectedId() {
		return selectedId;
	}

	public void setSelectedId(String selectedId) {
		this.selectedId = selectedId;
	}

	public String[] getSelectedIds() {
		return selectedIds;
	}

	public void setSelectedIds(String[] selectedIds) {
		this.selectedIds = selectedIds;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}
	
	public List<Map> getResultList() {
		return resultList;
	}

	public void setResultList(List<Map> resultList) {
		this.resultList = resultList;
	}
	
	    public String getQuery_offset() {
        return this.query_offset;
    }
    
    public void setQuery_offset(String offset){
        this.query_offset = offset;
    }    

        public String getQuery_dayId() {
        return this.query_dayId;
    }
    
    public void setQuery_dayId(String dayId){
        this.query_dayId = dayId;
    }    

        public String getQuery_etlTime() {
        return this.query_etlTime;
    }
    
    public void setQuery_etlTime(String etlTime){
        this.query_etlTime = etlTime;
    }    

        public String getQuery_cnts() {
        return this.query_cnts;
    }
    
    public void setQuery_cnts(String cnts){
        this.query_cnts = cnts;
    }    

        public String getQuery_weekGoneId() {
        return this.query_weekGoneId;
    }
    
    public void setQuery_weekGoneId(String weekGoneId){
        this.query_weekGoneId = weekGoneId;
    }
    
	public void setQuery_dayId_end(String query_dayId_end) {
		this.query_dayId_end = query_dayId_end;
	}
	
	public String getQuery_dayId_end() {
		return query_dayId_end;
	}

    
	
}
